package com.tom.feign.clients;

import com.tom.doc.CourseDoc;
import com.tom.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * feign的接口里面的方法必须和要调用的微服务的controller中的方法一摸一样
 */
@FeignClient(value = "service-search", fallbackFactory = FallbackFactorySystem.class)
public interface CourseFeignClient {
    @PostMapping("/course/courseOnLine")
    AjaxResult courseOnLine(@RequestBody CourseDoc doc);
    @PostMapping("/course/courseOffLine")
    AjaxResult courseOffLine(@RequestBody CourseDoc courseDoc);
}
